<!--
 * @Author: zhw 443844039@qq.com
 * @Date: 2025-08-23 20:13:21
 * @LastEditors: zhw 443844039@qq.com
 * @LastEditTime: 2025-08-23 21:11:49
 * @Description: 
-->
<template>
  <div class="panel">
    <div class="header">
      <div class="title-wrapper">
        <div class="blue-line"></div>
        <h3>教师综合排名榜</h3>
      </div>
    </div>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="rank" label="排名" width="90" align="center">
        <template slot-scope="scope">
          <el-button v-if="scope.$index+1 == 1" type="danger" round>{{ scope.$index+1 }}</el-button>
          <el-button v-else-if="scope.$index+1 == 2" type="warning" round>{{ scope.$index+1 }}</el-button>
          <el-button v-else-if="scope.$index+1 == 3" type="success" round>{{ scope.$index+1 }}</el-button>
          <el-button v-else type="info" round> {{ scope.$index+1 }}</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="create_by_name" label="姓名" width="180" align="center">
      </el-table-column>
      <el-table-column prop="collage_name" label="院系专业">
      </el-table-column>
      <el-table-column prop="count" label="学术获奖数"  width="120" align="center">
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { teacherRankApi } from '@/api/operationAnalysis'
export default {
  data() {
    return {
      tableData: [
        {
          rank: '1',
          name: '黎晓',
          professional: '艺术学院-视觉传达设计专业',
          num:'90'
        }, 
        {
          rank: '2',
          name: '肖骁',
          professional: '食品学院-食品检验检测技术专业',
          num:'80'
        }, 
        {
          rank: '3',
          name: '王西',
          professional: '计算机应用技术学院-软件工程专业',
          num:'70'
        }, 
        {
          rank: '4',
          name: '庆倾',
          professional: '学前教育学院-学前儿童发展科学专业',
          num:'60'
        },
        {
          rank: '5',
          name: '祖卿',
          professional: '机械制造学院-机械制造专业',
          num:'50'
        }
      ]
    }
  },
  created() {
    this.getDataList()
  },
  methods: {
    async getDataList() {
      const res = await teacherRankApi();
      this.tableData = res.data;
    }
  },
}
</script>
<style scoped lang="scss">
::v-deep .el-button--medium.is-round{
  padding: 5px 8px !important;
}
::v-deep .el-button--danger{
  background-color: #FF6632;
}
::v-deep .el-button--info{
  background-color: #F4F6FC;
  border: none !important;
  color: #AAAAAA

}
::v-deep .el-table td.el-table__cell{
  border-bottom: none !important;
}
::v-deep .el-table::before{
  background-color: transparent !important;
}
.panel {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 16px;
}

.header {
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.title-wrapper {
  display: flex;
  align-items: center;
}

.blue-line {
  width: 4px;
  height: 24px;
  background-color: #1E62FF;
  margin-right: 12px;
  border-radius: 2px;
}

.header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: 500;
}

.chart-container {
  width: 100%;
  height: 400px;
}
</style>